package com.lineage.list;

import com.lineage.server.model.Instance.L1PcInstance;
import java.util.ArrayList;

public class PcLvSkillList {
  public static ArrayList<Integer> scount(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    switch (pc.getType()) {
      case 0:
        if (pc.getLevel() >= 10) {
          int skillid = 0;
          while (skillid < 8) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        if (pc.getLevel() >= 20) {
          int skillid = 8;
          while (skillid < 16) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        break;
      case 1:
        if (pc.getLevel() >= 50) {
          int skillid = 0;
          while (skillid < 8) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        break;
      case 2:
        if (pc.getLevel() >= 8) {
          int skillid = 0;
          while (skillid < 8) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        if (pc.getLevel() >= 16) {
          int skillid = 8;
          while (skillid < 16) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        if (pc.getLevel() >= 24) {
          int skillid = 16;
          while (skillid < 23) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        break;
      case 3:
        if (pc.getLevel() >= 4) {
          int skillid = 0;
          while (skillid < 8) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        if (pc.getLevel() >= 8) {
          int skillid = 8;
          while (skillid < 16) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        if (pc.getLevel() >= 12) {
          int skillid = 16;
          while (skillid < 23) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        break;
      case 4:
        if (pc.getLevel() >= 12) {
          int skillid = 0;
          while (skillid < 8) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        if (pc.getLevel() >= 24) {
          int skillid = 8;
          while (skillid < 16) {
            skillList.add(new Integer(skillid));
            skillid++;
          } 
        } 
        break;
    } 
    return skillList;
  }
  
  public static ArrayList<Integer> isIllusionist(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    if (pc.getLevel() >= 10) {
      int skillid = 200;
      while (skillid < 208) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 20) {
      int skillid = 208;
      while (skillid < 212) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 30) {
      int skillid = 212;
      while (skillid < 216) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 40) {
      int skillid = 216;
      while (skillid < 220) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    return skillList;
  }
  
  public static ArrayList<Integer> isDragonKnight(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    if (pc.getLevel() >= 15) {
      int skillid = 180;
      while (skillid < 184) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 30) {
      int skillid = 184;
      while (skillid < 192) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 45) {
      int skillid = 192;
      while (skillid < 195) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    return skillList;
  }
  
  public static ArrayList<Integer> isDarkelf(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    if (pc.getLevel() >= 12) {
      int skillid = 0;
      while (skillid < 8) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 24) {
      int skillid = 8;
      while (skillid < 16) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 15) {
      int skillid = 96;
      while (skillid < 100) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
      skillList.add(new Integer(108));
    } 
    if (pc.getLevel() >= 30) {
      int skillid = 100;
      while (skillid < 104) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
      skillList.add(new Integer(109));
    } 
    if (pc.getLevel() >= 45) {
      int skillid = 104;
      while (skillid < 108) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
      skillList.add(new Integer(110));
    } 
    return skillList;
  }
  
  public static ArrayList<Integer> isWizard(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    if (pc.getLevel() >= 4) {
      int skillid = 0;
      while (skillid < 8) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 8) {
      int skillid = 8;
      while (skillid < 16) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 12) {
      int skillid = 16;
      while (skillid < 23) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 16) {
      int skillid = 24;
      while (skillid < 32) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 20) {
      int skillid = 32;
      while (skillid < 40) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 24) {
      int skillid = 40;
      while (skillid < 48) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 28) {
      int skillid = 48;
      while (skillid < 56) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 32) {
      int skillid = 56;
      while (skillid < 64) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 36) {
      int skillid = 64;
      while (skillid < 72) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 40) {
      int skillid = 72;
      while (skillid < 80) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    return skillList;
  }
  
  public static ArrayList<Integer> isElf(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    if (pc.getLevel() >= 8) {
      int skillid = 0;
      while (skillid < 8) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 16) {
      int skillid = 8;
      while (skillid < 16) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 24) {
      int skillid = 16;
      while (skillid < 23) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 32) {
      int skillid = 24;
      while (skillid < 32) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 40) {
      int skillid = 32;
      while (skillid < 40) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 48) {
      int skillid = 40;
      while (skillid < 48) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 10) {
      skillList.add(new Integer(128));
      skillList.add(new Integer(129));
      skillList.add(new Integer(130));
    } 
    if (pc.getLevel() >= 20) {
      skillList.add(new Integer(136));
      skillList.add(new Integer(137));
    } 
    if (pc.getLevel() >= 30) {
      skillList.add(new Integer(131));
      skillList.add(new Integer(144));
      skillList.add(new Integer(145));
      skillList.add(new Integer(146));
      switch (pc.getElfAttr()) {
        case 1:
          skillList.add(new Integer(150));
          skillList.add(new Integer(151));
          break;
        case 2:
          skillList.add(new Integer(147));
          break;
        case 4:
          skillList.add(new Integer(169));
          break;
        case 8:
          skillList.add(new Integer(148));
          skillList.add(new Integer(149));
          break;
      } 
    } 
    if (pc.getLevel() >= 40) {
      skillList.add(new Integer(132));
      skillList.add(new Integer(152));
      skillList.add(new Integer(153));
      switch (pc.getElfAttr()) {
        case 1:
          skillList.add(new Integer(156));
          skillList.add(new Integer(158));
          break;
        case 2:
          skillList.add(new Integer(154));
          break;
        case 4:
          skillList.add(new Integer(157));
          skillList.add(new Integer(159));
          break;
        case 8:
          skillList.add(new Integer(155));
          break;
      } 
    } 
    if (pc.getLevel() >= 50) {
      skillList.add(new Integer(133));
      skillList.add(new Integer(160));
      skillList.add(new Integer(161));
      switch (pc.getElfAttr()) {
        case 1:
          skillList.add(new Integer(167));
          skillList.add(new Integer(168));
          break;
        case 2:
          skillList.add(new Integer(162));
          skillList.add(new Integer(170));
          skillList.add(new Integer(174));
          skillList.add(new Integer(175));
          break;
        case 4:
          skillList.add(new Integer(163));
          skillList.add(new Integer(164));
          skillList.add(new Integer(172));
          break;
        case 8:
          skillList.add(new Integer(165));
          skillList.add(new Integer(166));
          skillList.add(new Integer(173));
          break;
      } 
    } 
    return skillList;
  }
  
  public static ArrayList<Integer> isKnight(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    if (pc.getLevel() >= 50) {
      int skillid = 0;
      while (skillid < 8) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 50) {
      skillList.add(new Integer(86));
      skillList.add(new Integer(87));
      skillList.add(new Integer(89));
      skillList.add(new Integer(90));
    } 
    if (pc.getLevel() >= 60)
      skillList.add(new Integer(89)); 
    return skillList;
  }
  
  public static ArrayList<Integer> isCrown(L1PcInstance pc) {
    ArrayList<Integer> skillList = new ArrayList<>();
    if (pc.getLevel() >= 10) {
      int skillid = 0;
      while (skillid < 8) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 20) {
      int skillid = 8;
      while (skillid < 16) {
        skillList.add(new Integer(skillid));
        skillid++;
      } 
    } 
    if (pc.getLevel() >= 15)
      skillList.add(new Integer(112)); 
    if (pc.getLevel() >= 30)
      skillList.add(new Integer(115)); 
    if (pc.getLevel() >= 40)
      skillList.add(new Integer(113)); 
    if (pc.getLevel() >= 45)
      skillList.add(new Integer(117)); 
    if (pc.getLevel() >= 50)
      skillList.add(new Integer(116)); 
    if (pc.getLevel() >= 55)
      skillList.add(new Integer(114)); 
    return skillList;
  }
}
